<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>RetroSnake: SnakerPlayer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">RetroSnake
   &#160;<span id="projectnumber">0.7.23</span>
   </div>
   <div id="projectbrief">Try to write a snake.io in cmd.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_snaker_player.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="class_snaker_player-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SnakerPlayer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>玩家主体  
 <a href="class_snaker_player.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_snaker_player_8h_source.html">SnakerPlayer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae286ee74a3315e1f226f2d7a1840cf3a"><td class="memItemLeft" align="right" valign="top"><a id="ae286ee74a3315e1f226f2d7a1840cf3a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snaker_player.html#ae286ee74a3315e1f226f2d7a1840cf3a">SnakerPlayer</a> (<a class="el" href="class_snaker_chunk.html">SnakerChunk</a> *spawn, <a class="el" href="class_snaker_map.html">SnakerMap</a> *map)</td></tr>
<tr class="memdesc:ae286ee74a3315e1f226f2d7a1840cf3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造函数 <br /></td></tr>
<tr class="separator:ae286ee74a3315e1f226f2d7a1840cf3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb346068ed8ef2139eb55d17d589a554"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snaker_player.html#aeb346068ed8ef2139eb55d17d589a554">Die</a> ()</td></tr>
<tr class="memdesc:aeb346068ed8ef2139eb55d17d589a554"><td class="mdescLeft">&#160;</td><td class="mdescRight">死亡钩子函数  <a href="class_snaker_player.html#aeb346068ed8ef2139eb55d17d589a554">More...</a><br /></td></tr>
<tr class="separator:aeb346068ed8ef2139eb55d17d589a554"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b519ecc380f6bd75d5820c82f9edca8"><td class="memItemLeft" align="right" valign="top"><a id="a4b519ecc380f6bd75d5820c82f9edca8"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snaker_player.html#a4b519ecc380f6bd75d5820c82f9edca8">~SnakerPlayer</a> ()</td></tr>
<tr class="memdesc:a4b519ecc380f6bd75d5820c82f9edca8"><td class="mdescLeft">&#160;</td><td class="mdescRight">析构函数 <br /></td></tr>
<tr class="separator:a4b519ecc380f6bd75d5820c82f9edca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0aa479f43b480249233b1038d7a2943b"><td class="memItemLeft" align="right" valign="top"><a id="a0aa479f43b480249233b1038d7a2943b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snaker_player.html#a0aa479f43b480249233b1038d7a2943b">AddBuff</a> (vector&lt; <a class="el" href="classbuff.html">buff</a> &gt; incomingBuff)</td></tr>
<tr class="memdesc:a0aa479f43b480249233b1038d7a2943b"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加buff <br /></td></tr>
<tr class="separator:a0aa479f43b480249233b1038d7a2943b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd520c90621d4b7d70db0d3ca62bffcd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snaker_player.html#abd520c90621d4b7d70db0d3ca62bffcd">Update</a> (int cmd, <a class="el" href="class_snaker_camera.html">SnakerCamera</a> *cam)</td></tr>
<tr class="memdesc:abd520c90621d4b7d70db0d3ca62bffcd"><td class="mdescLeft">&#160;</td><td class="mdescRight">每一帧对蛇进行更新  <a href="class_snaker_player.html#abd520c90621d4b7d70db0d3ca62bffcd">More...</a><br /></td></tr>
<tr class="separator:abd520c90621d4b7d70db0d3ca62bffcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a26782b7316bbfeaf057cafae10a0bd25"><td class="memItemLeft" align="right" valign="top"><a id="a26782b7316bbfeaf057cafae10a0bd25"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>isDead</b></td></tr>
<tr class="separator:a26782b7316bbfeaf057cafae10a0bd25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ec784c6d43e9ba3950f9b43eede85ce"><td class="memItemLeft" align="right" valign="top"><a id="a6ec784c6d43e9ba3950f9b43eede85ce"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>len</b></td></tr>
<tr class="separator:a6ec784c6d43e9ba3950f9b43eede85ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39564ec1e5d85b8f70146968a085daae"><td class="memItemLeft" align="right" valign="top"><a id="a39564ec1e5d85b8f70146968a085daae"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>score</b></td></tr>
<tr class="separator:a39564ec1e5d85b8f70146968a085daae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6702e305626a9728fb3ef81f8b128ca0"><td class="memItemLeft" align="right" valign="top"><a id="a6702e305626a9728fb3ef81f8b128ca0"></a>
list&lt; pair&lt; int, int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>posList</b></td></tr>
<tr class="separator:a6702e305626a9728fb3ef81f8b128ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac18299ad19825b1c9b387982d40fbc12"><td class="memItemLeft" align="right" valign="top"><a id="ac18299ad19825b1c9b387982d40fbc12"></a>
vector&lt; <a class="el" href="classbuff.html">buff</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>buffList</b></td></tr>
<tr class="separator:ac18299ad19825b1c9b387982d40fbc12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06b010609c12ca943ff6d23c5e9bdc31"><td class="memItemLeft" align="right" valign="top"><a id="a06b010609c12ca943ff6d23c5e9bdc31"></a>
string&#160;</td><td class="memItemRight" valign="bottom"><b>appearance</b></td></tr>
<tr class="separator:a06b010609c12ca943ff6d23c5e9bdc31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab08c39f0dcd345f9759c80cf01b3f3e1"><td class="memItemLeft" align="right" valign="top"><a id="ab08c39f0dcd345f9759c80cf01b3f3e1"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>speed</b></td></tr>
<tr class="separator:ab08c39f0dcd345f9759c80cf01b3f3e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39e670644326b49a310c7524ea6a907e"><td class="memItemLeft" align="right" valign="top"><a id="a39e670644326b49a310c7524ea6a907e"></a>
<a class="el" href="class_snaker_map.html">SnakerMap</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>map</b></td></tr>
<tr class="separator:a39e670644326b49a310c7524ea6a907e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02bc6b237e1ecff97a7d5c92c712b243"><td class="memItemLeft" align="right" valign="top"><a id="a02bc6b237e1ecff97a7d5c92c712b243"></a>
set&lt; <a class="el" href="class_snaker_chunk.html">SnakerChunk</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>chunkSet</b></td></tr>
<tr class="separator:a02bc6b237e1ecff97a7d5c92c712b243"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabcc60733b1f545a7f30f1d7d445d754"><td class="memItemLeft" align="right" valign="top"><a id="aabcc60733b1f545a7f30f1d7d445d754"></a>
vector&lt; pair&lt; pair&lt; char, int &gt;, pair&lt; int, int &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>paintBoard</b></td></tr>
<tr class="separator:aabcc60733b1f545a7f30f1d7d445d754"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>玩家主体 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">isDead</td><td>死亡标记，主函数在为true时跳过对其执行的所有操作，仅保留计分板 </td></tr>
    <tr><td class="paramname">len</td><td>长度，实际未投入使用 </td></tr>
    <tr><td class="paramname">score</td><td>分数 </td></tr>
    <tr><td class="paramname">speed</td><td>速度 </td></tr>
    <tr><td class="paramname">poslist</td><td>身体节点列表，在所有节点之间划线便是一整条蛇 </td></tr>
    <tr><td class="paramname">bufflist</td><td>这条蛇当前的所有buff，在buff持续时间为零时跳过这条buff </td></tr>
    <tr><td class="paramname">paintBoard</td><td>用来储存蛇身绘制信息的中转变量 </td></tr>
    <tr><td class="paramname">chunkSet</td><td>用来储存蛇所在chunks的集合 </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aeb346068ed8ef2139eb55d17d589a554"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb346068ed8ef2139eb55d17d589a554">&#9670;&nbsp;</a></span>Die()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SnakerPlayer::Die </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>死亡钩子函数 </p>
<p>主要用来把蛇身biu成P点 </p>

</div>
</div>
<a id="abd520c90621d4b7d70db0d3ca62bffcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd520c90621d4b7d70db0d3ca62bffcd">&#9670;&nbsp;</a></span>Update()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SnakerPlayer::Update </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_snaker_camera.html">SnakerCamera</a> *&#160;</td>
          <td class="paramname"><em>cam</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>每一帧对蛇进行更新 </p>
<p>转向（可选）<br  />
步进（依赖玩家当前的速度值）<br  />
执行bufflist，buff在这里具体实现<br  />
更新chunkSet和paintBoard，为绘制做准备<br  />
</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/include/<a class="el" href="_snaker_player_8h_source.html">SnakerPlayer.h</a></li>
<li>src/SnakerPlayer/SnakerPlayer.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_snaker_player.html">SnakerPlayer</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
